#!/bin/bash
# 修复polling hooks中的status访问

# 修复useCollectionTask.ts
sed -i "s/if (data && (data.status === 'RUNNING' || data.status === 'PENDING'))/if (data?.state && (data.state.status === 'RUNNING' || data.state.status === 'PENDING'))/" useCollectionTask.ts

# 修复useExportTask.ts  
sed -i "s/if (data && (data.status === 'RUNNING' || data.status === 'PENDING'))/if (data?.state && (data.state.status === 'RUNNING' || data.state.status === 'PENDING'))/" useExportTask.ts

echo "Polling status checks fixed"
